﻿CREATE TABLE [dbo].[Orden] (
    [Id]           INT          IDENTITY (1, 1) NOT NULL,
    [NumPedido]    VARCHAR (20) NULL,
    [CotizacionId] INT          NULL,
    [FecInicio]    DATETIME     NULL,
    [FecFinal]     DATETIME     NULL,
    [EmpresaId]    INT          NOT NULL,
    CONSTRAINT [PK_Orden] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Orden_Cotizacion] FOREIGN KEY ([CotizacionId]) REFERENCES [dbo].[Cotizacion] ([Id]),
    CONSTRAINT [FK_Orden_Empresa] FOREIGN KEY ([EmpresaId]) REFERENCES [dbo].[Empresa] ([Id])
);

